package com.niit.search.mapper;

import com.niit.search.entity.Topic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TopicMapper {
    
    @Select("SELECT id, content, topic_num as topicNum FROM tb_topic WHERE content LIKE CONCAT('%', #{keyword}, '%') LIMIT 20")
    List<Topic> searchTopicsByKeyword(String keyword);
}